package cn.wilson.hrm.doc;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

//课程的文档对象
@Document(indexName = "hrm" , type = "course")
public class CourseDoc {
    @Id //文档的id
    private Long id;
    /**
     *  课程名称
     */
    //使用分词器，映射
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    /**
     *  适用人群
     */
    private String name;

    /**
     *  简介
     */
    private String description;
    /**
     *  详情
     */
    private String intro;

    /**
     *  价格
     */
    private Float price;
    /**
     *  原价
     */
    private Float priceOld;
    /**
     *  课程分类
     */
    private Long courseTypeId;
    /**
     * 适用人群
     */
    private String users;
    /**
     *  等级名字
     */
    private String gradeName;
    /**
     * 课程等级
     */
    private Long gradeId;
    /**
     *  机构id
     */
    private Long tenantId;
    /**
     *  机构名称
     */
    private String tenantName;
    /**
     *  课程的开课时间
     */
    private Date startTime;
    /**
     *  课程的结课时间
     */
    private Date endTime;
    /**
     *  封面
     */
    private String pic;
    /**
     *  免费或者收费
     */
    private String chargeName;
    /**
     *  咨询qq
     */
    private String qq;
    /**
     *  上线时间
     */
    private Date onlineTime = new Date();
    /**
     *  浏览数
     */
    private Integer viewCount;
    /**
     *  购买数  销量
     */
    private Integer buyCount;
    /**
     *  评论数
     */
    private Integer commentCount;

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Float getPriceOld() {
        return priceOld;
    }

    public void setPriceOld(Float priceOld) {
        this.priceOld = priceOld;
    }

    public String getUsers() {
        return users;
    }

    public void setUsers(String users) {
        this.users = users;
    }

    public String getGradeName() {
        return gradeName;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public Long getGradeId() {
        return gradeId;
    }

    public void setGradeId(Long gradeId) {
        this.gradeId = gradeId;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getChargeName() {
        return chargeName;
    }

    public void setChargeName(String chargeName) {
        this.chargeName = chargeName;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public Date getOnlineTime() {
        return onlineTime;
    }

    public void setOnlineTime(Date onlineTime) {
        this.onlineTime = onlineTime;
    }

    public Integer getViewCount() {
        return viewCount;
    }

    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }

    public Integer getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Integer buyCount) {
        this.buyCount = buyCount;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Long getCourseTypeId() {
        return courseTypeId;
    }

    public void setCourseTypeId(Long courseTypeId) {
        this.courseTypeId = courseTypeId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    @Override
    public String toString() {
        return "CourseDoc{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", intro='" + intro + '\'' +
                ", price=" + price +
                ", priceOld=" + priceOld +
                ", courseTypeId=" + courseTypeId +
                ", users='" + users + '\'' +
                ", gradeName='" + gradeName + '\'' +
                ", gradeId=" + gradeId +
                ", tenantId=" + tenantId +
                ", tenantName='" + tenantName + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", pic='" + pic + '\'' +
                ", chargeName=" + chargeName +
                ", qq='" + qq + '\'' +
                ", onlineTime=" + onlineTime +
                ", viewCount=" + viewCount +
                ", buyCount=" + buyCount +
                '}';
    }
}
